package com.qigao.mall.commons.dto;

import com.qigao.mall.commons.enums.SettleStatusEnum;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;

/**
 * Copyright (C), 2020-2020
 * FileName: PromGroupDetailResultDto
 * Author:   luiz
 * Date:     2020/10/15 15:33
 * Description: 团购详情
 */
@Data
public class PromGroupDetailResultDto {
    private String groupNo;

    private String itemNo;

    private String stockNo;
    @ApiModelProperty("团员")
    private String buylerId;
    @ApiModelProperty("团员头像")
    private String buylerHeadUrl;
    @ApiModelProperty("团员昵称")
    private String buylerNickName;
    @ApiModelProperty("订单金额")
    private BigDecimal orderAmt;
    @ApiModelProperty("付款金额")
    private BigDecimal payAmt;
    @ApiModelProperty("是否命中  0:未命中 1:已命中")
    private Integer hitFlag;
    @ApiModelProperty("是否命中  0:未命中 1:已命中")
    private String hitFlagName;
    @ApiModelProperty("返还金额")
    private BigDecimal returnAmt;
    @ApiModelProperty("实际返还金额")
    private BigDecimal actReturnAmt;
    @ApiModelProperty("订单号")
    private String orderNo;
    @ApiModelProperty("付款序列号")
    private String paySeqNo;
    @ApiModelProperty("结算状态")
    private Integer settleStatus;
    @ApiModelProperty("结算状态名称")
    private String settleStatusName;
    @ApiModelProperty("结算时间")
    private String settleTime;

    public String getSettleStatusName() {
        return SettleStatusEnum.getNameByCode(this.settleStatus);
    }

    public String getHitFlagName() {
         if(1==this.hitFlag)return "命中";
         return "未命中";
    }
}
